/*
 * @Author: Mcc
 * @Date: 2024-07-29 10:17:14
 * @LastEditors: 王明明834578987 10266004+wang-mingming-834578987@user.noreply.gitee.com
 * @LastEditTime: 2024-09-25 14:43:36
 * @FilePath: \ft-apply-admin\src\api\applay\applicationList\self.ts
 * @Description: 
 * 
 * Copyright (c) 2024 by Mcc, All Rights Reserved. 
 */
//import type { GetUserInfoModel } from './model/userModel'
import { defHttp } from '@/utils/http/axios'
import { selectCommonConfigDetail } from "@/api/application-details";
import { get, post } from "@/api/application-details/http";
import { requestType } from "@/views/applicationDetails/application-type";

//import type { ErrorMessageMode } from '@/types/axios'

enum Api {
  tabulationPage = '/tabulation/page',// 全部
  tabulationResumePage = '/tabulation/page/link/resume', // 简历环节
  tabulationInterviewPage = '/tabulation/page/link/interview', // 面试环节
  tabulationTrainPage = '/tabulation/page/link/train',// 培训环节
  tabulationSigningPage = '/tabulation/page/link/signing',// 签约环节
  tabulationEntryPage = '/tabulation/page/link/entry',// 入职环节
  tabulationExport = '/tabulation/export', // 导出列表
  tabulationTodayPendingPage = '/tabulation/today/pending/page', // 今日待办
  tabulationBatchUpdatePreserveUser = '/tabulation/batchUpdate/preserveUser', // 批量修改维护HR
  tabulationBatchUpdateInterviewUser = '/tabulation/batchUpdate/interviewUser', // 批量修改约面HR
  tabulationBatchUpdateInterviewer = '/tabulation/batchUpdate/interviewer', // 批量修改面试HR
  fileUpResumesListPc = '/applicationUser/fileUpResumesListPc'
}

// 全部
export function tabulationPage(data) {
  return defHttp.post({ url: Api.tabulationPage, data })
}
// 简历环节
export function tabulationResumePage(data) {
  return defHttp.post({ url: Api.tabulationResumePage, data })
}
// 面试环节
export function tabulationInterviewPage(data) {
  return defHttp.post({ url: Api.tabulationInterviewPage, data })
}
// 培训环节
export function tabulationTrainPage(data) {
  return defHttp.post({ url: Api.tabulationTrainPage, data })
}
// 签约环节
export function tabulationSigningPage(data) {
  return defHttp.post({ url: Api.tabulationSigningPage, data })
}
// 入职环节
export function tabulationEntryPage(data) {
  return defHttp.post({ url: Api.tabulationEntryPage, data })
}
// 导出列表
export function tabulationExport(data) {
  return defHttp.post({ url: Api.tabulationExport, data, responseType: 'blob' }, { isTransformResponse: false })
}
// 今日待办
export function tabulationTodayPendingPage(data) {
  return defHttp.post({ url: Api.tabulationTodayPendingPage, data })
}
// 批量修改维护HR
export function tabulationBatchUpdatePreserveUser(data) {
  return defHttp.post({ url: Api.tabulationBatchUpdatePreserveUser, data })
}
// 批量修改约面HR
export function tabulationBatchUpdateInterviewUser(data) {
  return defHttp.post({ url: Api.tabulationBatchUpdateInterviewUser, data })
}
// 批量修改面试HR
export function tabulationBatchUpdateInterviewer(data) {
  return defHttp.post({ url: Api.tabulationBatchUpdateInterviewer, data })
}
// 根据类型获取配置项
export function selectCommonConfigDetail(param) {
  return get("/config/selectCommonConfigDetail", param)
}
// 获取角色id
export function selectUserByRole(params) {
  return get("/auth/selectUserByRole", params)
}// 获取角色id
export function selectCommonConfig(params) {
  return get("/config/selectCommonConfig", params)
}
// 培训期数
export function tabulationList(params) {
  return post("/tabulation/info/list", params)
}
// 状态
export function tabulationStatusList(params) {
  return post("/tabulation/status/list", params)
}

//参培确认 填写培训期数
export const joinTrainingNumber = (params: requestType) => {
  return post("/applicationUser/joinTrainingNumber", params)
}

//参培确认 填写培训期数
export const offlineInterviewTypeList = (params: any) => {
  return post("/applicationProcess/offlineInterviewTypeList", params,)
}

//批量修改面试HR
export const batchUpdateInterviewer = (params: any) => {
  return post("/tabulation/batchUpdate/interviewer", params,)
}

//批量修改维护HR
export const batchUpdatePreserveUser = (params: any) => {
  return post("/tabulation/batchUpdate/preserveUser", params,)
}

//批量修改约面HR
export const batchUpdateInterviewUser = (params: any) => {
  return post("/tabulation/batchUpdate/interviewUser", params,)
}

//取消线下面试（仅在应聘列表）
export const onlineInterviewType = (params: { resumeId: string | number }) => {  //待约培 （预约培训 未联系上 放弃）
  return get("/applicationProcess/onlineInterviewType", params)
}

//再次发送邮件
export const sendTrainingEmail = (params) => {
  return post("/training/sendTrainingEmail", params)
}
// 导入数据
export const fileUpResumesListPc = (params) => {
  return post("/applicationUser/fileUpResumesListPc", params)
}

export const batchResumeProgress = (params) => {  //简历环节 （批量操作通过 淘汰）
  return post("/applicationProcess/batchResumeProgress", params)
}
// export function doLogout() {
//   return defHttp.post({ url: Api.Logout })
// }

export default {
  selectCommonConfigDetail,
  selectUserByRole,
  selectCommonConfig,
  tabulationList,
  tabulationStatusList
}
